package com.googlecode.kipler.container.dl.operational;

import java.util.Comparator;

import com.googlecode.kipler.container.dl.Individual;
import com.googlecode.kipler.container.dl.SHOIQIndividual;


/**
 * 
 * @author İnanç Seylan
 * 
 */
public class SHOIQIndividualComparator implements Comparator<Individual> {

	public int compare(Individual arg0, Individual arg1) {
		SHOIQIndividual indv0 = (SHOIQIndividual) arg0;
		SHOIQIndividual indv1 = (SHOIQIndividual) arg1;
		int result = indv0.getLevel() - indv1.getLevel();
		if (result == 0 && indv0 != indv1) {
			result = indv0.getName().compareTo(indv1.getName());
		}
		return result;
	}

}
